<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <!-- v-on的缩写：@click="handleClick" 
                动态参数v-on:[eventname]="handleClick"
        -->
        <!-- <button v-on:click="handleClick">切换</button> -->
        <!-- <button @click="handleClick">切换</button> -->
        <button @[eventname]="handleClick">切换</button>


    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        let vm=new Vue({
            el:"#app",
            data:{
                msg:"√",
                eventname:"click"
            },
            methods:{
                handleClick:function(){
                    this.msg=(this.msg==="√"?"×":"√");
                }
            }


        })









    </script>
</body>
</html>